<h1>Listing Articles</h1>

<div>
<%= flash[:notice] %>
</div>

<div id="quick_search">
<h2>Title quick search</h2>
<%=render (:partial=>'form_article_source_search') %>
</div>


	<% for article in @articles  %>
	<table class="list_articles">
		<tr>
			<% for column in Article.content_columns %>
			<% #Removing body from the list, is too big for a simple list %>
					<% unless column.name == "body" or column.name == "blurb"%>
						<th><%= column.human_name %></th>
					<% end %>      
			<% end %>
		</tr>
		
		<tr>
			<% for column in Article.content_columns %>
				<% #Removing body from the list, is too big for a simple list%>
				<% unless column.name == "body" or column.name == "blurb"%>
					<td><%=h article.send(column.name) %></td>
				<% end %>
			<% end %>
		</tr>

		<tr>
			<th colspan=4 class="blurb"><%= column.human_name %></th>
		</tr>
		
		<tr>
			<td colspan=4><%=h article.send(column.name) %></td>
		</tr>
		
		<tr>
			<td colspan=4>
				<table>
					<tr>
						<td><%= link_to 'Show', :action => 'show_article', :id => article %></td>
						<td><%= link_to 'Edit', :action => 'edit_article', :id => article %></td>
						<td><%= link_to 'Destroy', { :action => 'destroy_article', :id => article }, :confirm => 'Are you sure?' %></td>
					</tr>
				</table>
			</td>
		</tr>
		
	</table>	
	<br />
<% end %>
	


<%= link_to 'Previous page', { :page => @article_pages.current.previous } if @article_pages.current.previous %>
<%= link_to 'Next page', { :page => @article_pages.current.next } if @article_pages.current.next %> 

<br />


